package effective.generic;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class CollectionUtils {

	public static <E> Set<E> union(Set<? extends E> s1, Set<? extends E> s2) {
		Set<E> result = new HashSet<E>(s1);
		result.addAll(s2);
		return result;
	}

	// Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
	Map<String, List<String>> anagrams = newHashMap();

	public static <K, V> HashMap<K, V> newHashMap() {
		return new HashMap<K, V>();
	}
}
